﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hui</title>
    <link rel="stylesheet" type="text/css" href="../css/app.css" />
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css" />
    
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.12.0.min.js"></script>
	<script type="text/javascript" src="../script/app.js" ></script>
    <style type="text/css">
		body{height:100%;}
    	/*.hui { background: #f4f5f9}*/
    	.W-active{
    		border:1px solid #ddb240;
    	}
    </style>
</head>
<body class="">

    <div class=" H-horizontal-left H-max-width-100-percent H-padding-horizontal-both-10 H-text-show-row-1">
        <div class="H-theme-font-color-999  H-flexbox-horizontal  H-box-sizing-border-box">
				<div class="H-text-align-center " style="margin:20px auto;">
                    <label class="H-display-block  H-margin-vertical-top-5 H-theme-font-color-333">
                    	<a class="user_level H-font-size-16">当前服务：普通会员</a><br/>
                    	<a style="display: block;" class="user_level_time H-font-size-14" id="vip_end_time">到期时间：2000-1-1</a>
                    </label>
                </div>
            </div>
    </div>
    
    <div class="H-border-radius-5-right-both  H-padding-horizontal-both-10 H-theme-background-color-white " style="width: 90%;margin:0px auto;">
    	 <span style="margin:5px auto;padding:5px 0px;" class="H-border-vertical-bottom-after H-center-all H-display-block  H-margin-vertical-top-5 "><a class="H-font-size-20 H-theme-font-colorddb240">在线办理</a></span>
    	<!-- <div class="H-text-align-center H-flexbox-horizontal ">
    	 	
    		<div class="H-display-table-cell H-width-avg-2 H-border-radius-5 H-font-size-15 H-outline-none H-theme-background-color-transparent H-padding-vertical-both-8 H-padding-horizontal-both-20 H-theme-font-colorddb240 H-theme-border-colorddb240 ">150金币 尊享会员1个月</div>
    		
    		<div class="H-display-table-cell H-width-avg-2 H-border-radius-5 H-font-size-15 H-outline-none H-theme-background-color-transparent H-padding-vertical-both-8 H-padding-horizontal-both-20 H-theme-font-colorddb240 H-theme-border-colorddb240">400金币 尊享会员3个月</div>
    		
    		<div class="H-display-table-cell H-width-avg-2 H-border-radius-5 H-font-size-15 H-outline-none H-theme-background-color-transparent H-padding-vertical-both-8 H-padding-horizontal-both-20 H-theme-font-colorddb240 H-theme-border-colorddb240">100金币  尊享会员12个月</div>
    		
    		<div class="H-display-table-cell H-width-avg-2 H-border-radius-5 H-font-size-15 H-outline-none H-theme-background-color-transparent H-padding-vertical-both-8 H-padding-horizontal-both-20 H-theme-font-colorddb240 H-theme-border-colorddb240">按钮名称</div>
    	 </div>-->
    	 <div id="list" style="text-align: center;" class="H-clear-both H-width-100-percent H-display-table H-box-sizing-border-box H-padding-horizontal-left-10 H-margin-vertical-top-20 H-theme-font-colorddb240">
	        <div onclick="swichType(this);"  data-url="http://www.kapaipai.com/detail/ACD19198BD626A4C"  class="level_btn H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-2 H-padding-horizontal-right-10 H-margin-vertical-bottom-10">
	           <div  class=" H-display-table-cell H-width-avg-2 H-border-radius-5 H-font-size-15 H-outline-none   H-theme-background-color-transparent H-padding-vertical-both-8 H-padding-horizontal-both-20 H-theme-border-colorddb240 ">1天会员,0.5/元</div>
	        </div>
	        <div  onclick="swichType(this);" data-url="http://www.kapaipai.com/detail/1693492D84690EA9"  class="level_btn H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-2 H-padding-horizontal-right-10 H-margin-vertical-bottom-10">
	           <div  class=" H-display-table-cell H-width-avg-2 H-border-radius-5 H-font-size-15 H-outline-none H-theme-background-color-transparent H-padding-vertical-both-8 H-padding-horizontal-both-20  H-theme-border-colorddb240">7天会员,1/元</div>
	        </div>
	        <div  onclick="swichType(this);"   data-url="http://www.kapaipai.com/detail/8F25E433FF42F353" class="level_btn H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-2 H-padding-horizontal-right-10 H-margin-vertical-bottom-10">
	            <div  class="H-display-table-cell H-width-avg-2 H-border-radius-5 H-font-size-15 H-outline-none H-theme-background-color-transparent H-padding-vertical-both-8 H-padding-horizontal-both-20 H-theme-border-colorddb240">1个月会员,2/元</div>
	        </div>
	        <div onclick="swichType(this);" data-url="http://www.kapaipai.com/detail/DBA26F27AF502E2C" class="level_btn H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-2 H-padding-horizontal-right-10 H-margin-vertical-bottom-10">
	            <div class="H-display-table-cell H-width-avg-2 H-border-radius-5 H-font-size-15 H-outline-none H-theme-background-color-transparent H-padding-vertical-both-8 H-padding-horizontal-both-20  H-theme-border-colorddb240">1年会员,10/元</div>
	        </div>
	        
	        <div onclick="swichType(this);" data-url="http://www.kapaipai.com/detail/306724A115263505" class="level_btn H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-2 H-padding-horizontal-right-10 H-margin-vertical-bottom-10">
	            <div  class="H-display-table-cell H-width-avg-2 H-border-radius-5 H-font-size-15 H-outline-none H-theme-background-color-transparent H-padding-vertical-both-8 H-padding-horizontal-both-20  H-theme-border-colorddb240">永久会员,30/元</div>
	        </div>
	        
	        
	     </div>
	    
    	 <div class="H-padding-vertical-bottom-20"></div>
    </div>
    
    
  
    <div onclick="subtn();" class="H-padding-15 H-margin-vertical-top-10">
        <button class="H-button H-width-100-percent  H-font-size-15 H-outline-none H-padding-vertical-both-15 H-padding-horizontal-both-20 H-theme-background-color-497bf0 H-theme-font-color-white H-border-radius-3">充 值</button>
    </div>
    



	<script>
	
		token = localStorage.getItem('token');
		var id = "";
		var cert_flag = "";
		var user_level_status = "";
		var cert = "";
		
		var pay_url = "";
		apiready = function(){
			            
			api.addEventListener({
	            name:'push_user_info'
            },function(ret,err){
            	token = localStorage.getItem('token');
            	
            	if(token !='' && token!=null  && typeof token !='undefined'){
					userInfo = $api.getStorage('userinfo');
					
					if( userInfo.vip == 1){
					
						$(".user_level").text('当前服务：体验会员');
					} else if( userInfo.vip == 2){
						$(".is_vip").show();
						$(".user_level").text('当前服务：钻石会员');
						
					} else {
						$("#user_level").text( "当前服务：未开通会员" );
					}
					
					$("#vip_end_time").text(   _formatDate(userInfo.vip_end_time *1000) + " 到期"  );
				}
            });
			if(token !='' && token!=null  && typeof token !='undefined'){
				userInfo = $api.getStorage('userinfo');
				
				if( userInfo.vip == 1){
				
					$(".user_level").text('当前服务：体验会员');
				} else if( userInfo.vip == 2){
					$(".is_vip").show();
					$(".user_level").text('当前服务：钻石会员');
					
				} else {
					$("#user_level").text( "当前服务：未开通会员" );
				}
				
				$("#vip_end_time").text(   _formatDate(userInfo.vip_end_time *1000) + " 到期"  );
			}
		}
		
		

	    
	  
	    
	    
	    function swichType(el){
	    
//	    	id = $(el).attr('attr-id');
//	    	
			pay_url = $(el).attr('data-url');

	    	$("#list .level_btn div").removeClass('H-theme-background-colorddb240');
	    	$("#list .level_btn div").removeClass('H-theme-background-color-transparent');
	    	$("#list .level_btn div").removeClass('H-theme-font-color-white');
	    	$(el).find('div').addClass('H-theme-background-colorddb240');
	    	$(el).find('div').addClass('H-theme-font-color-white');
	    }
	    
	    //办理会员
	    function subtn(){
	    	if( pay_url ==''){
	    		$app.toast('请选择充值金额');
	    		return false;
	    	}
	    	var browser = api.require('webBrowser');
			browser.open({
			    url: pay_url,
			    scaleEnabled:false,
			    titleBar:{
			    	bg:"#fff",
			    	textColor:"#333",
			    },
			    progress:{
			    	color:"#86a7f2"
			    }
			});
			
//	    	_openWinHead('kefu_body','kefu_body' ,'会员充值')
	    }
	    
	    function _openWinHead(name,url,title){
			token = localStorage.getItem('token');
			if(token !='' && token!=null  && token!='undefined'){
				
				$app.openWinByUrl(name+'win_head','./win_head',{'fname':name,'furl':url,'title':title});
			}else{
				login();
			}
		}
		function login(){
			$app.openWinByUrl('login','login')
		}
		
		
		    
    	

	</script>
</body>
</html>